package com.hspedu.writer;

import java.io.*;

/**
 * @author 谷其昊
 * @version 1.0
 * @date 2022/2/24
 * @time 23:22
 */
public class BufferedCopy02 {
    public static void main(String[] args) throws IOException {
        BufferedInputStream bufferedInputStream = new BufferedInputStream(new FileInputStream("D:\\BaiduNetdiskDownload\\韩顺平2021基础学Java\\资料\\分享资料\\高山流水.mp3"));
        BufferedOutputStream bufferedOutputStream = new BufferedOutputStream(new FileOutputStream("D:\\BaiduNetdiskDownload\\韩顺平2021基础学Java\\资料\\分享资料\\高山流水2.mp3"));

        byte[] bytes = new byte[1024];
        int readLen = 0;

        while ((readLen = bufferedInputStream.read(bytes)) != -1){
            bufferedOutputStream.write(bytes,0,readLen);
        }

        bufferedInputStream.close();
        bufferedOutputStream.close();

    }
}
